package cn.yjr.vector.tools;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharedPreferencesHelper
{
  public static String PERSONAL_CENTER_PREFERENCES_NAME;
  public static String PREFERENCES_NAME = "yi_jia_ren";
  Context context;
  SharedPreferences.Editor editor;
  SharedPreferences sp;

  static
  {
    PERSONAL_CENTER_PREFERENCES_NAME = "personal_center";
  }

  public SharedPreferencesHelper(Context paramContext)
  {
    this.context = paramContext;
    this.sp = paramContext.getSharedPreferences(PREFERENCES_NAME, 0);
    this.editor = this.sp.edit();
  }

  public SharedPreferencesHelper(Context paramContext, String paramString)
  {
    this.context = paramContext;
    this.sp = paramContext.getSharedPreferences(paramString, 0);
    this.editor = this.sp.edit();
  }

  public SharedPreferences.Editor getEditor()
  {
    return this.editor;
  }

  public int getIntValue(String paramString)
  {
    return getIntValue(paramString, 0);
  }

  public int getIntValue(String paramString, int paramInt)
  {
    return this.sp.getInt(paramString, paramInt);
  }

  public SharedPreferences getSharedPreferences()
  {
    return this.sp;
  }

  public String getStringValue(String paramString)
  {
    return getStringValue(paramString, null);
  }

  public String getStringValue(String paramString1, String paramString2)
  {
    return this.sp.getString(paramString1, paramString2);
  }

  public void putBoolean(String paramString, Boolean paramBoolean)
  {
    this.editor.putBoolean(paramString, paramBoolean.booleanValue());
    this.editor.commit();
  }

  public void putInt(String paramString, int paramInt)
  {
    this.editor.putInt(paramString, paramInt);
    this.editor.commit();
  }

  public void putString(String paramString1, String paramString2)
  {
    this.editor.putString(paramString1, paramString2);
    this.editor.commit();
  }
}